package sanshui.system.trade.factory.trade.strategy;

import sanshui.system.trade.common.CommonResponse;
import sanshui.system.trade.db.entity.TradeAccountTbl;
import sanshui.system.trade.db.entity.TradeResultVo;
import sanshui.system.trade.factory.trade.TradeSystemContext;
import sanshui.system.trade.factory.trade.indicator.IndicatorResult;
import sanshui.system.trade.model.TradeAccountModel;
import sanshui.system.trade.pojo.StockInfo;
import sanshui.system.trade.pojo.StockInfoVo;
import sanshui.system.trade.pojo.ao.PreComputeGridTradeAo;
import sanshui.system.trade.pojo.vo.PreComputeResultVo;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface StrategyRun {
    /**
     * 策略指标输出结果
     * */
    List<StrategyResult> _choose(Map<String, StockInfoVo> stockInfoVoMap);
    List<StrategyResult> _call(List<IndicatorResult> chooseResult);
    /**
     * 更新策略内账户信息
     * */
    Boolean updateAccount(TradeAccountModel tradeAccountModel);
    void setTradeSystemContext(TradeSystemContext tradeSystemContext);


    CommonResponse<Boolean> _init();
    CommonResponse<Boolean> _buy(BigDecimal price, BigDecimal num, String code);
    CommonResponse<Boolean> _sell(BigDecimal price, BigDecimal num, String code);
    @Deprecated
    CommonResponse<Boolean> _call_pre(StockInfo stockInfo);
    /**
     * 账户更新
     * */
    CommonResponse<Boolean> _call_pre(Map<String, StockInfo> data);
    CommonResponse<Boolean> _update();
    @Deprecated
    CommonResponse<StrategyResult> _call(StockInfoVo stockInfo);
    CommonResponse<StrategyResult> _call(Map<String, StockInfoVo> data);
    CommonResponse<TradeResultVo> result();
    CommonResponse<String> _feeSell(BigDecimal price, BigDecimal num);
    CommonResponse<String> _feeBuy(BigDecimal price, BigDecimal num);
    CommonResponse<Boolean> _save();
    CommonResponse<PreComputeResultVo> preCompute(PreComputeGridTradeAo gridInitParam, StrategyCode strategyCode);
}
